package com.centaline.crawler.service.impl;

import com.centaline.crawler.excel.ComareaExcel;
import com.centaline.crawler.json.Comarea;
import com.centaline.crawler.mapper.ComareaMapper;
import com.centaline.crawler.service.ComareaService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.web.servlet.ServletComponentScan;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author: wbzhangzp
 * @date: 2021-05-27 14:21
 */
@Service
public class ComareaServiceImpl implements ComareaService {

    @Autowired
    private ComareaMapper comareaMapper;

    @Override
    public void saveArea(Comarea comarea) {
        comareaMapper.saveArea(comarea);
    }

    @Override
    public List<Comarea> findByXAndY(Double x, Double y) {
        List<Comarea> comareas = comareaMapper.findByXAndY(x, y);
        return comareas;
    }

    @Override
    public List<ComareaExcel> findAll() {
        List<ComareaExcel> excelList = comareaMapper.findAll();

        return excelList;
    }
}
